import pygame


class EndScreen:
    def __init__(self, screen):
        self.screen = screen
        self.image = pygame.image.load("images/gameover.png")


    def run(self):
        font = pygame.font.SysFont("Arial", 48)
        while True:
            self.screen.fill((0, 0, 0))
            self.screen.blit(self.image, (370, 200))
            text = font.render("PRESS ANY KET TO EXIT", True, (255, 255, 255))
            self.screen.blit(text, (180, 500))
            pygame.display.flip()

            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    pygame.quit()
                    exit()
                if event.type == pygame.KEYDOWN:
                    pygame.quit()
                    exit()